package Zuoye;

import java.util.Scanner;

public class ATM {
    public static void main(String[] args) {
        System.out.println("请选择1-4");
        Scanner sc=new Scanner(System.in);
        boolean flag=true;
        double qian=0;
    while (flag){
        System.out.println("1.收支明细");
        System.out.println("2.登记收入");
        System.out.println("3.登记支出");
        System.out.println("4.退出");
           int res= sc.nextInt();
        if  (res==1) {
            System.out.println("打工");
        } else if (res==2) {
            System.out.println("本次收入金额为");

            double jinqian= sc.nextDouble();
            qian=qian+jinqian;
        } else if (res==3) {
            System.out.println("本次支出的金额为");
               double zhichu= sc.nextDouble();
               qian=qian-zhichu;


        }


    }

    }


}
